package com.youdianstar.app.util

import com.youdianstar.app.R
import com.stripe.android.model.CardBrand


/**
 * File: CardIcUtil
 * Author: 82149 Create: 2021/11/25 16:42
 * Changes (from 2021/11/25)
 * --------------------------------------------------
 * description: 卡数据
 * ---------------------------------------------------
 *
 */
object CardIcUtil {

    fun getStripeBrandIcon(brand:String) : Int{
        return when(brand){
            CardBrand.Visa.displayName, CardBrand.Visa.code -> CardBrand.Visa.icon
            CardBrand.MasterCard.displayName, CardBrand.MasterCard.code -> CardBrand.MasterCard.icon
            CardBrand.JCB.displayName, CardBrand.JCB.code -> CardBrand.JCB.icon
            CardBrand.AmericanExpress.displayName, CardBrand.AmericanExpress.code -> CardBrand.AmericanExpress.icon
            CardBrand.Discover.displayName, CardBrand.Discover.code -> CardBrand.Discover.icon
            CardBrand.DinersClub.displayName, CardBrand.DinersClub.code -> CardBrand.DinersClub.icon
            CardBrand.UnionPay.displayName, CardBrand.UnionPay.code -> CardBrand.UnionPay.icon
            else -> R.mipmap.ic_pay_bankcard//CardBrand.Unknown.icon
        }
    }

    fun getStripeDefaultIcon() = R.mipmap.ic_pay_bankcard//CardBrand.Unknown.icon
}